//package com.rocksdata.mip.ui.fragment;
//
//import android.content.Intent;
//import android.view.View;
//import android.widget.AdapterView;
//import android.widget.Toast;
//
//
//import com.hyphenate.chat.EMClient;
//import com.hyphenate.chat.EMConversation;
//import com.rocksdata.mip.Constant;
//import com.rocksdata.mip.R;
//
///**
// * Created by 陈堂正 on 2017/4/18.
// */
//
//public class MessageFragment extends EaseConversationListFragment {
//    @Override
//    protected void setUpView() {
//        super.setUpView();
//        titleBar.setTitle("消息");
//        titleBar.setBackgroundColor(getResources().getColor(R.color.color_529DE8));
//        titleBar.setRightImageResource(R.mipmap.em_add);
//        titleBar.setRightLayoutClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                startActivity(new Intent(getActivity(), ChatContactListActivity.class));
//            }
//        });
//
//        conversationListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
//
//            @Override
//            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
//                EMConversation conversation = conversationListView.getItem(position);
//                String username = conversation.conversationId();
//                if (username.equals(EMClient.getInstance().getCurrentUser()))
//                    Toast.makeText(getActivity(), R.string.Cant_chat_with_yourself, Toast.LENGTH_SHORT).show();
//                else {
//                    // start chat acitivity
//                    Intent intent = new Intent(getActivity(), ChatActivity.class);
//                    if(conversation.isGroup()){
//                        if(conversation.getType() == EMConversation.EMConversationType.ChatRoom){
//                            // it's group chat
//                            intent.putExtra(Constant.EXTRA_CHAT_TYPE, Constant.CHATTYPE_CHATROOM);
//                        }else{
//                            intent.putExtra(Constant.EXTRA_CHAT_TYPE, Constant.CHATTYPE_GROUP);
//                        }
//
//                    }
//                    // it's single chat
//                    intent.putExtra(Constant.KEY_USER_ID, username);
//                    startActivity(intent);
//                }
//            }
//        });
//    }
//}
